<?php 
namespace app\app\model;
use think\Model;
use think\Db;

/**
* 商户模型
*/
class Store extends Model
{
	public $user_id;

	public function getAll($page)
	{
		$Num = config('pageNum');
		$pageNum = $Num*($page-1);			
		$where['status']  = array('eq',1);
		$data = $this->field('id,name,phone,address,description,concat("'.config('IMG_HEAD').'",image) image,lgt,lat')->where($where)->limit($pageNum,$Num)->select();
		return $data;		
	}

	/**
	 * [getOne 获取单个商户信息]
	 * @return [type] [description]
	 */
	public function getOne($id)
	{
		$data = Db::name('store')->where('id','eq',$id)->field('start_price,distribute')->find();
		return $data;
	}

}